<!--
 * @Author: Rice 8280209+thats-all-right-ha-ha@user.noreply.gitee.com
 * @Date: 2024-01-30 11:38:25
 * @LastEditors: Rice 8280209+thats-all-right-ha-ha@user.noreply.gitee.com
 * @LastEditTime: 2024-01-30 12:04:34
 * @FilePath: \vue-test\src\components\XhTitle.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <header class="header">
    <h1>小黑记事本</h1>
    <input placeholder="请输入任务" class="new-todo" v-model="content" @keyup.enter="add" />
    <button class="add" @click="add" >添加任务</button>
  </header>
</template>

<script>
export default {
  data() {
    return {
      content: "",
    };
  },
  methods: {
    add() {
      this.$emit("addContent", this.content);
      this.content = "";
    },
  },
};
</script>

<style>
</style>